package com.smt.modules.app.utils;

import com.smt.modules.app.controller.AppPushMessageController;

import java.util.Collection;
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.ConcurrentMap;

/**
 * @author zhangyi
 * @date 2018/11/9 11:57
 */
public class WebSocketMapUtil {
    public static ConcurrentMap<String, AppPushMessageController> webSocketMap = new ConcurrentHashMap<>();
    public static void put(String key, AppPushMessageController myWebSocket){
        webSocketMap.put(key, myWebSocket);
    }

    public static AppPushMessageController get(String key){
        return webSocketMap.get(key);
    }

    public static void remove(String key){
        webSocketMap.remove(key);
    }

    public static Collection<AppPushMessageController> getValues(){
        return webSocketMap.values();
    }
}
